package schema

import (
	"errors"
)

// 支付宝APP支付参数
type UnionpayB2BParams struct {
	OrderID  string `json:"order_id"`
	Describe string `json:"describe"`
	Price    int64  `json:"price"`
	Url      string `json:"url"`
	Tag      string `json:"tag"`
}

func (a *UnionpayB2BParams) Validate() error {
	if a.OrderID == "" ||
		a.Describe == "" ||
		a.Price <= 0 {
		return errors.New("缺少必要参数")
	}
	return nil
}
